@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* 全局样式 - 深色模式 */
:root {
    --primary-color: #8E2DE2; /* 鲜明的紫色 */
    --accent-color: #4A00E0;  /* 较深的紫色，用于 hover */
    --text-color-light: #E0E0E0; /* 浅色文本 */
    --text-color-dark: #A0A0A0;  /* 较暗的文本，用于次要信息 */
    --bg-dark-main: #1A1A2E;     /* 主背景深色 */
    --bg-dark-secondary: #0F0F1A;/* 次要背景更深 */
    --card-bg: #27273F;          /* 卡片背景深灰色 */
    --border-color: #3A3A5E;    /* 边框颜色 */
    --border-radius: 12px;
    --shadow-dark: 0 5px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover-dark: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color-light);
    background-color: var(--bg-dark-main); /* 主背景深色 */
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

section {
    padding: 100px 0;
    margin: 40px auto; 
    max-width: 1200px;
    border-radius: var(--border-radius);
    background-color: var(--card-bg); /* 卡片背景深灰色 */
    box-shadow: var(--shadow-dark);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

section:nth-of-type(even) {
    background-color: var(--bg-dark-secondary); /* 交替背景色增加视觉区分 */
}

h1, h2, h3, h4 {
    color: var(--text-color-light);
    margin-bottom: 20px;
    font-weight: 600;
}

h1 {
    font-size: 3.8em; /* 略微加大标题 */
    font-weight: 700;
}

h2 {
    font-size: 2.8em;
    text-align: center;
    margin-bottom: 70px; /* 增加间距 */
    position: relative;
}

h2::after {
    content: '';
    width: 80px; /* 加长下划线 */
    height: 4px; /* 加粗下划线 */
    background-color: var(--primary-color);
    position: absolute;
    left: 50%;
    bottom: -20px;
    transform: translateX(-50%);
    border-radius: 2px;
}

h3 {
    font-size: 2em;
}

p {
    color: var(--text-color-dark);
    margin-bottom: 15px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.btn-primary:hover {
    background-color: var(--accent-color);
    box-shadow: var(--shadow-hover-dark);
    transform: translateY(-5px);
    text-decoration: none;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-dark-secondary); /* 更深的导航栏背景 */
    /* backdrop-filter: blur(10px); */ /* 移除，因为背景已不透明 */
    padding: 15px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4); /* 调整阴影以适应更深的背景 */
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.navbar .nav-links {
    list-style: none;
    display: flex;
}

.navbar .nav-links li {
    margin-left: 35px;
}

.navbar .nav-links a {
    color: var(--text-color-light);
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

.navbar .nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.navbar .nav-links a:hover::after {
    width: 100%;
}

/* 英雄区 */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: none;
    box-shadow: none;
    margin: 0;
    border-radius: 0;
}

.hero-section .container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 80px;
    text-align: left;
    padding: 0 20px;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 4.5em;
    margin-bottom: 25px;
    line-height: 1.1;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.4em;
    color: var(--text-color-dark);
    margin-bottom: 35px;
}

.hero-image {
    flex-shrink: 0;
}

.hero-image img {
    width: 380px;
    height: 380px;
    border-radius: 50%;
    object-fit: cover;
    border: 8px solid var(--primary-color); /* 更粗的边框 */
    box-shadow: var(--shadow-dark);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-image img:hover {
    transform: scale(1.05) rotate(2deg); /* 更有趣的悬停效果 */
    box-shadow: var(--shadow-hover-dark);
}

/* 照片轮播区 */
.carousel-section {
    padding: 80px 0;
}

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dark);
    overflow: hidden;
}

.carousel-slide {
    display: none;
    width: 100%;
    height: 550px; /* 轮播图更大 */
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-slide:first-child {
    display: block;
}

.carousel-prev, .carousel-next {
    background-color: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 3em;
    padding: 12px 18px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    top: 50%;
    transform: translateY(-50%);
    position: absolute;
    z-index: 10;
}

.carousel-prev:hover, .carousel-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 25px;
}

.carousel-next {
    right: 25px;
}

.carousel-dots {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.carousel-dots .dot {
    width: 14px;
    height: 14px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.carousel-dots .dot.active {
    background-color: var(--primary-color);
    transform: scale(1.3);
}

/* 关于我区域 */
.about-section .container {
    display: flex;
    flex-wrap: wrap;
    gap: 70px;
    justify-content: center;
    align-items: flex-start;
}

.about-text {
    flex: 2;
    min-width: 300px;
}

.about-skills {
    flex: 1;
    min-width: 250px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.skill-item {
    text-align: center;
    padding: 30px 20px;
    background-color: var(--bg-dark-secondary);
    border-radius: var(--border-radius);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.skill-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover-dark);
}

.skill-item i {
    font-size: 3.5em;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.skill-item span {
    display: block;
    font-weight: 500;
    color: var(--text-color-light);
    font-size: 1em;
}

/* 作品集区域 */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 35px;
    margin-top: 50px;
}

.portfolio-item {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dark);
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.portfolio-item:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-hover-dark);
}

.portfolio-item img {
    width: 100%;
    height: 250px; /* 作品集图片更大 */
    object-fit: cover;
    display: block;
}

.portfolio-item h3 {
    padding: 25px 25px 8px;
    margin-bottom: 0;
    font-size: 1.6em;
    color: var(--text-color-light);
}

.portfolio-item p {
    padding: 0 25px 25px;
    color: var(--text-color-dark);
    font-size: 0.95em;
}

/* 联系表单 */
.contact-form {
    max-width: 750px;
    margin: 50px auto 0;
    padding: 50px;
    border-radius: var(--border-radius);
    background-color: var(--bg-dark-secondary);
    box-shadow: var(--shadow-dark);
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--text-color-light);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1em;
    color: var(--text-color-light);
    background-color: var(--card-bg);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(142, 45, 226, 0.25);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* 页脚区域 */
.footer {
    background-color: var(--bg-dark-secondary); /* 与次要背景协调 */
    color: #BDC3C7;
    padding: 50px 0;
    text-align: center;
    margin-top: 100px;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.footer p {
    margin: 0;
    color: #95A5A6;
}

.social-links {
    display: flex;
    gap: 30px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px; 
    height: 45px;
    border-radius: 50%; /* 圆形背景 */
    background-color: rgba(255, 255, 255, 0.1); /* 轻微的背景，与深色调协调 */
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease; /* 添加color过渡 */
    font-size: 1.8em; /* 设置图标字体大小 */
    color: #BDC3C7; /* 默认图标颜色 */
}

.social-icon img {
    /* 移除 img 相关的样式，因为我们不再使用 img 标签 */
    /* width: 100%; */
    /* height: 100%; */
    /* object-fit: contain; */
    /* border-radius: 0; */
    /* transition: filter 0.3s ease; */
}

.social-icon:hover {
    transform: scale(1.4); /* 悬停时放大 */
    background-color: var(--primary-color); /* 悬停时背景色变化 */
}

/* 各平台品牌颜色悬停效果 - 直接修改图标颜色 */
.social-icon.bilibili:hover { color: #00A1D6; background-color: rgba(0, 161, 214, 0.2); } /* 哔哩哔哩蓝 */
.social-icon.douyin:hover { color: #FFFFFF; background-color: rgba(255, 255, 255, 0.2); } /* 抖音 - 白色 */
.social-icon.kuaishou:hover { color: #FD5027; background-color: rgba(253, 80, 39, 0.2); } /* 快手橙 */
.social-icon.xiaohongshu:hover { color: #FF2442; background-color: rgba(255, 36, 66, 0.2); } /* 小红书红 */

/* AI 对话界面 (模态框) */
.ai-chat-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85); /* 更深的半透明背景 */
    align-items: center;
    justify-content: center;
    opacity: 0; /* 默认完全透明 */
    transition: opacity 0.3s ease-out; /* 整体淡入淡出 */
}

.ai-chat-modal.active {
    display: flex; /* 模态框容器显示 */
    opacity: 1; /* 整体淡入 */
}

.ai-chat-modal.active .modal-content {
    opacity: 1; /* 内容完全不透明 */
    transform: scale(1) translate(0, 0); /* 内容放大到正常大小并居中 */
}

.modal-content {
    background-color: var(--card-bg);
    padding: 35px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 850px;
    box-shadow: var(--shadow-hover-dark);
    display: flex;
    flex-direction: column;
    height: 90%;
    max-height: 950px;
    position: relative;
    opacity: 0; /* 默认内容透明 */
    transform: scale(0.5) translateX(50%) translateY(50%); /* 默认内容缩小并向右下角偏移 */
    transform-origin: bottom right; /* 动画从右下角开始 */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out; /* 内容的动画效果 */
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.modal-header h3 {
    margin-bottom: 10px;
    font-size: 2.2em;
    color: var(--primary-color);
}

.modal-header p {
    color: var(--text-color-dark);
    font-size: 1.05em;
}

.modal-header .close-btn {
    position: absolute;
    top: 25px;
    right: 35px;
    color: var(--text-color-dark);
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s ease;
}

.modal-header .close-btn:hover {
    color: var(--primary-color);
}

.chat-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 25px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    background-color: var(--bg-dark-secondary);
}

.chat-message {
    display: flex;
    margin-bottom: 20px;
    max-width: 88%;
}

.chat-message.user {
    margin-left: auto;
    justify-content: flex-end;
}

.chat-message.ai {
    margin-right: auto;
    justify-content: flex-start;
}

.chat-message p {
    background-color: #3A3A5E; /* AI 消息背景深色 */
    color: var(--text-color-light);
    padding: 14px 20px;
    border-radius: 22px;
    margin: 0;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 1.1em;
}

.chat-message.user p {
    background-color: var(--primary-color);
    color: white;
}

.chat-input-area {
    display: flex;
    gap: 18px;
    margin-bottom: 25px;
}

.chat-input-area input {
    flex-grow: 1;
    padding: 16px 22px;
    border: 1px solid var(--border-color);
    border-radius: 28px;
    font-size: 1.1em;
    color: var(--text-color-light);
    background-color: var(--bg-dark-secondary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.chat-input-area input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(142, 45, 226, 0.25);
    outline: none;
}

.chat-input-area .btn-send {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-size: 1.3em;
}

.chat-input-area .btn-send:hover {
    background-color: var(--accent-color);
    transform: scale(1.08);
}

.chat-controls {
    display: flex;
    justify-content: center;
    gap: 25px;
}

.chat-controls .btn-control {
    background-color: var(--card-bg);
    color: var(--text-color-light);
    padding: 12px 22px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    font-weight: 500;
}

.chat-controls .btn-control:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    transform: translateY(-3px);
}

/* 返回顶部按钮 */
.back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.8em;
    cursor: pointer;
    box-shadow: var(--shadow-dark);
    transition: all 0.3s ease;
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    background-color: var(--accent-color);
    transform: translateY(-7px) scale(1.1);
    box-shadow: var(--shadow-hover-dark);
}

/* AI 助手悬浮按钮 */
.ai-float-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 30px;
    right: 110px; /* 避免与返回顶部按钮重叠 */
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 28px;
    font-size: 1.1em;
    cursor: pointer;
    box-shadow: var(--shadow-dark);
    transition: all 0.3s ease;
    z-index: 999;
}

.ai-float-btn i {
    margin-right: 12px;
    font-size: 1.4em;
}

.ai-float-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-7px) scale(1.08);
    box-shadow: var(--shadow-hover-dark);
}

/* 响应式设计 */
@media (max-width: 992px) {
    h1 {
        font-size: 3.5em;
    }
    h2 {
        font-size: 2.2em;
        margin-bottom: 50px;
    }
    h2::after {
        bottom: -15px;
    }
    .hero-section .container {
        flex-direction: column;
        text-align: center;
        gap: 50px;
    }
    .hero-image img {
        width: 300px;
        height: 300px;
        border-width: 6px;
    }
    .navbar .nav-links {
        display: none;
    }
    section {
        padding: 70px 0;
        margin: 30px auto;
    }
    .carousel-slide {
        height: 400px;
    }
    .carousel-prev, .carousel-next {
        font-size: 2.5em;
        padding: 10px 15px;
    }
    .about-section .container {
        flex-direction: column;
        gap: 50px;
    }
    .contact-form {
        padding: 40px;
    }
    .modal-content {
        width: 95%;
        height: 95%;
        padding: 25px;
    }
    .modal-header .close-btn {
        top: 20px;
        right: 25px;
        font-size: 32px;
    }
    .ai-float-btn {
        right: 80px;
        padding: 14px 22px;
        font-size: 1em;
    }
    .ai-float-btn i {
        margin-right: 10px;
        font-size: 1.3em;
    }
    .back-to-top {
        right: 25px;
        width: 55px;
        height: 55px;
        font-size: 1.6em;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 2.8em;
    }
    h2 {
        font-size: 2em;
        margin-bottom: 40px;
    }
    .hero-image img {
        width: 250px;
        height: 250px;
        border-width: 5px;
    }
    .carousel-slide {
        height: 300px;
    }
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    }
    .modal-content {
        padding: 20px;
    }
    .modal-header h3 {
        font-size: 1.8em;
    }
    .modal-header .close-btn {
        font-size: 30px;
    }
    .chat-input-area input {
        padding: 14px 18px;
    }
    .chat-input-area .btn-send {
        width: 48px;
        height: 48px;
        font-size: 1.1em;
    }
    .chat-controls {
        flex-direction: column;
        gap: 12px;
    }
    .ai-float-btn {
        right: 20px;
        bottom: 80px;
        font-size: 0.9em;
        padding: 12px 18px;
    }
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.4em;
    }
}
